
// 0-9
const unsigned char CODE[10] = {0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f};

int LEDPins[] = {
  0, 1, 2, 3, 4, 5, 6, 7
};

void setup() {
  // put your setup code here, to run once:
  pinMode(LEDPins[0], OUTPUT);
  pinMode(LEDPins[1], OUTPUT);
  pinMode(LEDPins[2], OUTPUT);
  pinMode(LEDPins[3], OUTPUT);
  pinMode(LEDPins[4], OUTPUT);
  pinMode(LEDPins[5], OUTPUT);
  pinMode(LEDPins[6], OUTPUT);
  pinMode(LEDPins[7], OUTPUT);
}

void trans(unsigned char value) {
  for (int i = 0; i < 8; i++) {
    digitalWrite(LEDPins[i], !bitRead(value, i));
  }
}

void loop() {
  // put your main code here, to run repeatedly:
  for (int i = 0; i < 10; i++) {
    trans(CODE[i]);
    delay(1000);
  }
}
